package com.heima.a07_demo.server.controller;

import com.heima.a07_demo.common.result.Result;
import com.heima.a07_demo.pojo.entity.DiagnosisRecord;
import com.heima.a07_demo.pojo.vo.DashboardVO;
import com.heima.a07_demo.server.service.DiagnosisRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/diagnosisrecord")
public class DiagnosisRecordController {
    @Autowired
    private DiagnosisRecordService diagnosisRecordService;

    /**
     * 主界面数据展示
     * @param id
     * @return
     */
    @GetMapping("/baseData/{id}")
    public Result<DashboardVO> getDiagnosisRecord(@PathVariable("id") Long id) {

        DashboardVO data = diagnosisRecordService.getDiagnosisRecordById(id);
        return Result.success(data);

    }
}
